eval(read('/apps/notex.jsx'));
notex.usage('The app administration service',
            {username: 'The "admin/apps" service username',
             password: 'The "admin/apps" service password',
             action: 'The action to perform',
             service: 'JSON format of a app to update or add'});
notex.service.auth('admin/apps');

// Setup database options
var options; eval('options=' + read('../options.jsx'));

// Handle service inserts, updates, deletes and selects
var action = param('action') || 'select';
var app = param('app'); if (app) eval('app=' + app);
var result = notex.service.orm.action(action, 'apps', app, options);
write(result.toXMLString());

// END
